#include"../logs/viclog.h"


void test_log(const std::string &name){
    
     
    INFO("%s","测试开始");
    viclog::Logger::ptr logger=viclog::LoggerManager::getInstance().getLogger(name);
    logger->debug("%s","测试");
    logger->info("%s","测试");
    logger->warn("%s","测试");
    logger->error("%s","测试");
    logger->fatal("%s","测试");
    
    INFO("%s","测试结束");
  
    



}
int main()
{
    std::unique_ptr<viclog::LoggerBuilder> builder(new viclog::GlobalLoggerBuilder());
    builder->buildLoggerName("async_logger");
    builder->buildLoggerLevel(viclog::LogLevel::value::DEBUG);
    builder->buildFormatter();
    builder->buildLoggerType(viclog::LoggerType::LOGGER_SYNC);
    //builder->buildEnableUnSafeAsync();
    builder->buildSink<viclog::FileSink>("./logfile/sync.log");
    builder->buildSink<viclog::StdoutSink>();
    builder->buildSink<viclog::RollBySizeSink>("./logfile/roll-sync-by-size.log",1024*1024);

    builder->build();
    test_log("async_logger");
   
}